<template>
<div class="app">
    <h2>Vue:{{ message }}</h2>
    <Home></Home>
</div>
</template>
<script>
import Home from './Home.vue'
import eventBus from './utils/event-bus';
export default {
    components: {
        Home
    },
    data() {
        return {
            message:"hello"
        }
    },
    created(){
        // 监听组件发送来的事件
        eventBus.on("eventemit", (name,age) => {
            console.log("eventemit", name, age)
            this.message=`name:${name},${age}`
        })
    }
}
</script>
<style scoped lang="less">

</style>